package com.ddwl.common.feign.api;

import com.ddwl.schema.bo.base.PageBo;
import com.ddwl.schema.bo.gate.LoanSentSmsFlowBo;
import com.ddwl.schema.bo.gate.SentSmsFlowDto;
import com.ddwl.schema.bo.message.ShopMessageBo;
import com.ddwl.schema.bo.message.TempSentSmsBo;
import com.ddwl.schema.bo.message.WebSocketMessageBo;
import com.ddwl.schema.vo.base.PageVo;
import com.ddwl.schema.vo.base.RestVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author hemiaojun
 * @Date 2020/12/7 17:46
 */
@FeignClient(name = "ddwl-message" ,path = "/message")
public interface MessageApi {

    /**
     * 发送短信
     * @param bo
     * @return
     */
    @PostMapping("/sms/sent")
    @ApiOperation("发送短信")
    RestVo sentSms(@RequestBody TempSentSmsBo bo);

    /**
     * 查询短信列表
     * @param bo
     * @return
     */
    @PostMapping("/sms/getSmsPage")
    @ApiOperation(value = "查询短信列表")
    RestVo<PageVo<LoanSentSmsFlowBo>> getSmsPage(@RequestBody PageBo<SentSmsFlowDto> bo);

    /**
     * 查询短信数量
     * @param bo
     * @return
     */
    @PostMapping("/sms/getSmsCount")
    @ApiOperation(value = "查询短信数量")
    RestVo<Integer> getSmsCount(@RequestBody SentSmsFlowDto bo);

    /**
     * webSocket推送消息
     * @param bo
     * @return
     */
    @PostMapping("/webSocket/push")
    @ApiOperation("webSocket推送消息到web端")
    RestVo<String> pushToWeb(@RequestBody WebSocketMessageBo bo);

    /**
     * 给指定店铺推送消息
     * @param bo
     * @return
     */
    @PostMapping("/shopMessageNotice/pushMessageToShop")
    RestVo pushMessageToShop(@RequestBody ShopMessageBo bo);

}
